package br.com.psu.protocom.converter.impl;

import java.util.List;

import br.com.psu.protocom.converter.Converter;
import br.com.psu.protocom.message.ServiceMessage;

import com.google.gson.Gson;

/**
 * 
 * @author iuryteixeira
 * @author leonardotorres
 * 
 */
public class ConverterImpl implements Converter<ServiceMessage> {

	private Gson jsonEngine;
	
	public ConverterImpl() {
		super();
	    jsonEngine = new Gson();
	}

	@Override
	public String convert(ServiceMessage object) {
		return jsonEngine.toJson(object);
	}

	@Override
	public ServiceMessage convert(String json) {
		return jsonEngine.fromJson(json, ServiceMessage.class);
	}

	@Override
	public List<ServiceMessage> listConvert(String json) {
		return null;
	}

}
